package com.ruoyi.project.system.domain.vo;

import com.ruoyi.project.system.domain.SysProduct;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

@NoArgsConstructor
@Data
public class ProductVo {

    private Integer productId;

    private String productName;

    private BigDecimal customizedPrice;

    private BigDecimal VIPPrice;

    private BigDecimal supRoyalty;

    private BigDecimal royalty;

    private BigDecimal maxRoyalty;

    private BigDecimal maxBrokerage;

    private BigDecimal price;

    private BigDecimal fenRui;

    private BigDecimal brokerage;

    private BigDecimal defaRoyalty;

    public ProductVo(SysProduct sysProducts) {
        this.productId = sysProducts.getProductId();
        this.productName = sysProducts.getProductName();
    }

    public ProductVo(SysProduct sysProducts, BigDecimal customizedPrice, BigDecimal supRoyalty) {
        this.productId = sysProducts.getProductId();
        this.productName = sysProducts.getProductName();

        this.customizedPrice = customizedPrice;
        this.supRoyalty = supRoyalty;
        this.maxBrokerage = sysProducts.getMaxBrokerage();
        this.royalty = sysProducts.getRoyalty();
        this.maxRoyalty = sysProducts.getMaxRoyalty();
        this.price = customizedPrice.add(supRoyalty).add(sysProducts.getBrokerage());
    }

//    public ProductVo(SysProduct sysProducts, BigDecimal customizedPrice, BigDecimal supRoyalty) {
//        this.productId = sysProducts.getProductId();
//        this.productName = sysProducts.getProductName();
//        this.customizedPrice = customizedPrice;
//        BigDecimal zj = customizedPrice.add(supRoyalty).add(sysProducts.getBrokerage());
//        BigDecimal chouRui = getChouRui(zj);
//        this.fenRui = chouRui;
//        this.supRoyalty = supRoyalty;
//        this.brokerage = sysProducts.getBrokerage().subtract(chouRui);
//        this.maxBrokerage = sysProducts.getMaxBrokerage();
//
//        this.royalty = sysProducts.getRoyalty();
//        this.maxRoyalty = sysProducts.getMaxRoyalty();
//    }

}
